<%@page import="cn.cdahua.basic.model.SystemContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="style.jsp"></jsp:include>
<style>
body {
	background-color: #FFF;
}
</style>
</head>
<body>
	<div class="table-responsive">
		<div>
			<c:if test="${r_id == 1 }">
				普通管理员
			</c:if>
			<c:if test="${r_id == 4 }">
				教师
			</c:if>
			<c:if test="${r_id == 3 }">
				普通用户
			</c:if>
		</div>
		<table class="table table-hover table-condensed table-bordered">
			<thead>
				<tr>
					<th class="title">用户名</th>
					<th>姓名</th>
					<th>邮箱</th>
					<th>创建时间</th>
					<th>上次登录时间</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<c:forEach items="${datas.datas }" var="t">
				<tr>
					<th class="title"><div>${t.username }</div></th>
					<th>${t.nickname }</th>
					<th>${t.email }</th>
					<th>${t.createDate }</th>
					<th>${t.lastLoginDate }</th>
					<th><a
						href="<%=request.getContextPath() %>/system/user/list/${r_id}/${t.id}/update">
							<button class="btn btn-default">
								<c:if test="${t.status == 1 }">使用中</c:if>
								<c:if test="${t.status == 0 }">已停用</c:if>
							</button>
					</a></th>
					<th><a
						href="<%=request.getContextPath() %>/system/user/list/${r_id}/${t.id}/reset">
							<button class="btn btn-default">重置密码</button>
					</a>&nbsp;
						<button class="btn btn-danger">删除</button></th>
				</tr>
			</c:forEach>
			<c:if test="${isStudent == false }">
				<tr>
					<th colspan="7">
						<a href="<%=request.getContextPath() %>/system/user/add">
							<button class="btn btn-default">添加用户</button>
						</a>
					</th>
				</tr>
			</c:if>
		</table>
	</div>
	<jsp:include page="pager.jsp"></jsp:include>
</body>
</html>